<template>
  <div class="equipmentFile_item">
    <div class="title">
      <p class="state"></p>
      <p class="sb_name">设备名称: {{ data.sb }}</p>
      <p class="number">设备编号: {{ data.number }}</p>
    </div>
    <div class="item">
      <div class="info_item" v-for="(item, i) in infos" :key="item.icon">
        <van-icon :name="item.icon" color="blue" />
        <span> {{ item.name }}: </span>
        <span class="item_val" :class="data.state == 1 && i == 1 ? 'color_0' : 'color_1'">
          {{ item.val }}</span
        >
        <img v-if="i == infos.length - 1" src="@/assets/images/back.svg" class="more" />
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue';

const props = defineProps({
  icon: {
    type: String,
    required: '',
  },
  data: {
    type: Object,
    default: () => {
      return {};
    },
  },
  stateList: {
    type: Array,
    default: () => {
      return ['紧急', '严重', '一般', '完成'];
    },
  },
  colorList: {
    type: Array,
    default: () => {
      return ['#EA7949', '#EA4949', '#0A92FE', '#E8F1FF'];
    },
  },
});
const infos = ref([
  { icon: 'chat', name: '用户ID', val: '666' },
  { icon: 'chat', name: '部门', val: '能源部' },
  { icon: 'chat', name: '手机', val: '13666666666' },
  { icon: 'chat', name: '负责人', val: '张三三' },
]);
</script>

<style lang="scss" scoped>
.equipmentFile_item {
  position: relative;
  padding-top: 12px;
  padding-left: 12px;
  width: 100%;
  font-weight: bold;
  margin: 12px 0;
  border-bottom: 1px solid rgba(227, 227, 227, 0.2);
  .item {
    line-height: 40px;
    font-weight: 400;
    font-size: 13px;
    color: #666666;
  }
  .title {
    display: flex;
    gap: 0 24px;
    height: 24px;
    font-weight: bold;
    .state {
      width: 10px;
      height: 13px;
      background: #0a92fe;
    }
    .sb_name {
      height: 24px;
      font-weight: bold;
      font-size: 14px;
      color: #333333;
      line-height: 24px;
    }
    .number {
      color: rgba(44, 100, 164, 1);
    }
  }

  .info_item {
    height: 24px;
    margin: 4px 0;
    height: 24px;
    font-weight: 400;
    font-size: 13px;
    color: #666666;
    line-height: 24px;
  }
  .more {
    position: absolute;
    right: 24px;
    transform: rotate(180deg);
  }
}
</style>
